<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = "?key=你&age=18&name=lisi"
        var res = str.slice(1).split('&')

        console.log(res)
        var key = res[0].split("=")[1];
        var age = res[1].split("=")[1];
        var name = res[2].split("=")[1];
        var obj = {
            key,
            age,
            name
        };
        console.log(obj)
        
    </script>
</body>
</html>